package com.sysu.ooad.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.Action;
import com.sysu.ooad.dto.TaskFacade;
import com.sysu.ooad.entity.Student;
import com.sysu.ooad.service.TaskService;

@Component
@Scope("prototype")
public class IndexStudentAction extends CommonAction {
	private List<TaskFacade> taskList;
	private TaskService taskService;
	public List<TaskFacade> getTaskList() {
		return taskList;
	}
	public void setTaskList(List<TaskFacade> taskList) {
		this.taskList = taskList;
	}
	public TaskService getTaskService() {
		return taskService;
	}
	@Resource
	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}
	@Override
	public String execute() throws Exception {
		Student s = this.findCurrentStudent();
		taskList = taskService.findTasksByStudentWithHomework(s);
		return Action.SUCCESS;
	}
	
	
}
